<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // let a = 'age';
        // let bool = true;

        // let arr = [1,2,3];

        // let fn = function(){
        //     console.log("函数");
        // }

        // let obj = {
        //     name:"老王",
        //     [fn]:18
        // }

        // for(let item in obj){
        //     console.log(typeof item);
        //     if(typeof item === 'function'){
        //         console.log(item());
        //     }
        // }


        // console.log(obj);
        // console.log(obj[bool]);

        // console.log(obj.true);

        // console.log(obj[arr]);

        // console.log(obj["1,2,3"]);

        // console.log(obj[fn]);

        // console.log(obj[`function(){
        //     console.log("函数");
        // }`]);

        let arr2 = [1,2,3];
        
        // map 数据结构 - 键名、键值 可以随意保存任何数据类型。
        let map1 = new Map([
            [
                'name',
                '老王'
            ],
            [
                arr2,
                '18岁'
            ],
            [
                function fn(){
                    console.log("函数本身");
                },
                "成功"
            ]
        ]);

        console.log(map1);

        let arr = [...map1.keys()];
        console.log(arr);

        arr[2]()

        arr[1].push(666)
        console.log(arr[1]);

        console.log(map1.size);

        map1.set('like','篮球')

        console.log(map1);

        // console.log(map1.get('name'));
        console.log(map1.get(arr2));
    </script>
</body>
</html>